public class problem85 {
    public static void main(String[] args) {
//        N*(N+1)*M*(M+1)/4

        long numberA = 0;
        long numberB = 0;
        long previousDifference = 2000000;

        for(long x=1; x<100; x++) {
            for(long y=1; y<100; y++) {
                long sum = ((x * (x + 1) * y * (y + 1))) / 4;
                long difference = Math.abs(2000000 - sum);
                if(difference < previousDifference) {
                    numberA = x;
                    numberB = y;
                    previousDifference = difference;
                }
            }
        }

        System.out.println(numberA + " " + numberB);
        System.out.println(numberA * numberB);
    }
}
